﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TomShane.Neoforce.Controls;

namespace BlackAndWhiteBalance.CustomControls
{
    public class TextChangeButton : Button
    {
        bool isFirstText = true;
        public bool IsFirstText
        {
            get { return isFirstText; }
            set { isFirstText = value; SetupText(); }
        }

        string firstText, secondText;

        public TextChangeButton(Manager manager, string firstText, string secondText)
            : base(manager)
        {
            Text = firstText;
            this.firstText = firstText;
            this.secondText = secondText;
        }

        protected override void OnClick(TomShane.Neoforce.Controls.EventArgs e)
        {
            base.OnClick(e);

            isFirstText = !isFirstText;
            SetupText();
        }

        void SetupText()
        {
            if (!isFirstText)
            {
                Text = secondText;
            }
            else
            {
                Text = firstText;
            }
        }
    }
}
